<template>
	<view class="nav">
		<scroll-view scroll-x class="bg-white nav">
			<view class="flex text-center">
				<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in ticket" :key="index"
				 @tap="tabSelect" :data-id="index">
					<view class="flex">
						<view class="flex-sub">
							{{item.name}}
							<view v-if="item.promotionContent" class="cu-tag tag round sm bg-gradual-orange nev-tag margin-left-xs">{{item.promotionContent}}</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ticket: [{
					name: '高铁票',
					promotionContent: '热门'
				}],
				TabCur: 0
			};
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
			}
		}
	}
</script>

<style lang="scss">
.nev-tag{
	text-align: center;
	line-height: 32upx;
	position: relative;
}
</style>
